package com.wpml.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wpml.common.util.PageUtils;
import com.wpml.common.util.Query;
import com.wpml.product.dao.SpuInfoDescDao;
import com.wpml.product.entity.SpuInfoDescModel;
import com.wpml.product.service.SpuInfoDescService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * spu信息介绍(PmsSpuInfoDesc)表服务实现类
 *
 * @author makejava
 * @since 2020-04-07 11:33:37
 */
@Service
@Slf4j
public class SpuInfoDescServiceImpl extends ServiceImpl<SpuInfoDescDao, SpuInfoDescModel> implements SpuInfoDescService {
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SpuInfoDescModel> page = this.page(
                new Query<SpuInfoDescModel>().getPage(params),
                new QueryWrapper<>()
        );

        return new PageUtils(page);
    }

    @Override
    public void saveSpuInfoDesc(SpuInfoDescModel descEntity) {
        this.baseMapper.insert(descEntity);
    }
}
